:root {
  --primary-color: #3498db;
  --secondary-color: #2980b9;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --gray-color: #95a5a6;
  --white-color: #fff;
  --black-color: #333;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--black-color);
  background-color: #f5f5f5;
}

a {
  text-decoration: none;
  color: var(--success-color);
}

a:hover {
  color: var(--success-color);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.btn {
  display: inline-block;
  background: var(--success-color);
  color: var(--white-color);
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--secondary-color);
  color: var(--white-color);
}

/* 头部样式 */
.header {
  background: var(--success-color);
  color: var(--white-color);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.main-nav ul {
  display: flex;
  list-style: none;
}

.main-nav ul li {
  margin-left: 20px;
}

.main-nav ul li a {
  color: var(--white-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.main-nav ul li a:hover {
  color: var(--primary-color);
}

.main-nav ul li a.active {
  color: var(--primary-color);
  font-weight: bold;
}

/* 主要内容布局 */
.main-content {
  display: flex;
  margin: 30px auto;
  gap: 30px;
}

.content {
  flex: 2;
}

.sidebar {
  flex: 1;
}

/* 文章列表样式 */
.blog-posts {
  margin-bottom: 30px;
}

.blog-posts h2 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.post {
  background: var(--white-color);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post h3 {
  margin-bottom: 10px;
}

.post h3 a {
  color: var(--dark-color);
}

.post h3 a:hover {
  color: var(--primary-color);
}

.post-meta {
  font-size: 14px;
  color: var(--gray-color);
  margin-bottom: 15px;
}

.post-meta .date {
  margin-right: 15px;
}

.post p {
  margin-bottom: 15px;
}

.read-more {
  display: inline-block;
  font-weight: bold;
  transition: all 0.3s ease;
}

.read-more:hover {
  color: var(--secondary-color);
}

/* 侧边栏样式 */
.widget {
  background: var(--white-color);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.widget h3 {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.profile-img {
  display: block;
  margin: 0 auto 15px;
  border-radius: 50%;
}

.categories {
  list-style: none;
}

.categories li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #eee;
}

.categories li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.subscribe-form input {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* 页脚样式 */
.footer {
  background: var(--dark-color);
  color: var(--white-color);
  padding: 30px 0;
  text-align: center;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.social-links {
  margin-top: 15px;
}

.social-links a {
  color: var(--white-color);
  margin: 0 10px;
  font-size: 20px;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

/* 回到顶部按钮 */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: var(--white-color);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 99;
}

#back-to-top:hover {
  background: var(--secondary-color);
}

/* 文章页样式 */
.article-container {
  margin: 30px auto;
}

.article-content {
  background: var(--white-color);
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.article-content h1 {
  margin-bottom: 15px;
  font-size: 32px;
}

.article-meta {
  font-size: 14px;
  color: var(--gray-color);
  margin-bottom: 20px;
}

.article-meta span {
  margin-right: 15px;
}

.featured-image {
  display: block;
  margin: 0 auto 20px;
  max-height: 400px;
  object-fit: cover;
  border-radius: 5px;
}

.article-body h2 {
  margin: 25px 0 15px;
  font-size: 24px;
}

.article-body p {
  margin-bottom: 15px;
}

.article-body pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
  overflow-x: auto;
}

.article-body code {
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}

.article-footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.tags a {
  display: inline-block;
  background: #f5f5f5;
  padding: 3px 8px;
  margin-right: 5px;
  border-radius: 3px;
  font-size: 14px;
  color: var(--gray-color);
}

.tags a:hover {
  background: var(--primary-color);
  color: var(--white-color);
}

/* 评论区域样式 */
.comments-section {
  background: var(--white-color);
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.comments-section h2 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.comment {
  display: flex;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.comment:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.comment-author {
  flex: 0 0 100px;
  text-align: center;
}

.comment-author img {
  border-radius: 50%;
  margin-bottom: 5px;
}

.comment-content {
  flex: 1;
  padding-left: 20px;
}

.comment-meta {
  font-size: 12px;
  color: var(--gray-color);
  margin-top: 5px;
}

.comment-form {
  margin-top: 30px;
}

.comment-form h3 {
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* 关于我页面样式 */
.about-container {
  margin: 30px auto;
}

.about-section {
  background: var(--white-color);
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.about-section h2 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.about-content {
  display: flex;
  gap: 30px;
}

.about-img {
  flex: 0 0 300px;
  border-radius: 5px;
  object-fit: cover;
}

.about-text {
  flex: 1;
}

.about-text h3 {
  font-size: 24px;
  margin-bottom: 5px;
}

.title {
  font-size: 16px;
  color: var(--gray-color);
  margin-bottom: 15px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 15px 0;
}

.skills li {
  background: #f5f5f5;
  padding: 5px 10px;
  margin: 0 10px 10px 0;
  border-radius: 3px;
  font-size: 14px;
}

.contact-section {
  background: var(--white-color);
  padding: 30px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.contact-section h2 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.contact-methods {
  display: flex;
  gap: 30px;
}

.contact-info {
  flex: 1;
}

.contact-info ul {
  list-style: none;
}

.contact-info li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.contact-info i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.contact-form {
  flex: 1;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
  }

  .about-content {
    flex-direction: column;
  }

  .about-img {
    margin-bottom: 20px;
  }

  .contact-methods {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
  }

  .logo {
    margin-bottom: 15px;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
  }

  .main-nav ul li {
    margin: 5px 0;
  }

  .article-content,
  .comments-section,
  .about-section,
  .contact-section {
    padding: 20px;
  }
}
